Repository navigation
Conversation
ditadi
force-pushed
the
stack/database-dev-flow/07-apps-init
branch
from
October 20, 2026 12:22
7db9fa1 to
81e2e8f
Compare
ditadi
force-pushed
the
stack/database-dev-flow/08-db-check
branch
from
October 20, 2026 12:22
8ef366e to
0d6a48a
Compare
Contributor
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 45822406965 -R databricks/appkit -n appkit-template-0.105.0-pr.8dbffb8-stack-database-dev-flow-08-db-check-678 -D appkit-pr-678 \
&& unzip -o "appkit-pr-678/appkit-template-0.105.0-pr.8dbffb8-stack-database-dev-flow-08-db-check-678.zip" -d "appkit-pr-678" \
&& databricks apps init --template "appkit-pr-678"The template pins |
This was referenced Oct 20, 2026
Draft
Contributor
📦 Bundle size reportCompared against
|
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 1.6 MB (+36 KB) | 587 KB (+11 KB) |
| Type declarations | 503 KB (+5.5 KB) | 183 KB (+2.0 KB) |
| Source maps | 3.2 MB (+70 KB) | 1.1 MB (+21 KB) |
| Other | 11 KB | 3.7 KB |
| Total | 5.3 MB (+111 KB) | 1.8 MB (+34 KB) |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
118 KB (+22 B) | 2.4 KB | 121 KB (+22 B) | external | 378 KB (+30 B) |
./beta |
127 KB (+250 B) | 4.6 KB (+25 B) | 132 KB (+275 B) | external | 382 KB (+799 B) |
./beta/database-tooling |
62 KB (+6.2 KB) | 0 B | 62 KB (+6.2 KB) | external | 186 KB (+19 KB) |
./testing |
47 KB (-2 B) | 38 KB (+21 B) | 85 KB (+19 B) | external | 246 KB (+30 B) |
./tsdown |
630 B | 0 B | 630 B | external | 1.0 KB |
./type-generator |
31 KB (+25 B) | 0 B | 31 KB (+25 B) | external | 89 KB (+30 B) |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 114 KB |
. |
utils.js |
initial | 4.6 KB |
. |
remote-tunnel-manager.js |
lazy | 2.4 KB |
./beta |
beta.js |
initial | 101 KB |
./beta |
stream-manager.js |
initial | 5.9 KB |
./beta |
define-schema.js |
initial | 5.9 KB |
./beta |
service-context.js |
initial | 4.3 KB |
./beta |
modular.js |
initial | 3.6 KB |
./beta |
databricks.js |
initial | 3.3 KB |
./beta |
wide-event-emitter.js |
initial | 2.8 KB |
./beta |
client.js |
initial | 645 B |
./beta |
index.js |
initial | 20 B |
./beta |
index.js |
lazy | 4.1 KB |
./beta |
supervisor-api.js |
lazy | 201 B |
./beta |
databricks.js |
lazy | 188 B |
./beta |
index.js |
lazy | 124 B |
./beta/database-tooling |
index.js |
initial | 62 KB |
./testing |
manifest.js |
initial | 33 KB |
./testing |
index.js |
initial | 10 KB |
./testing |
wide-event-emitter.js |
initial | 2.9 KB |
./testing |
index.js |
lazy | 34 KB |
./testing |
remote-tunnel-manager.js |
lazy | 2.4 KB |
./testing |
utils.js |
lazy | 1.8 KB |
./tsdown |
index.js |
initial | 630 B |
./type-generator |
index.js |
initial | 31 KB |
@databricks/appkit-ui
npm tarball (packed): 393 KB — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 430 KB | 146 KB |
| Type declarations | 250 KB | 93 KB |
| Source maps | 837 KB | 281 KB |
| CSS | 16 KB | 3.2 KB |
| Total | 1.5 MB | 522 KB |
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
./js |
5.3 KB | 49 KB | 55 KB | 208 KB | 14 KB |
./js/beta |
2.4 KB | 0 B | 2.4 KB | 0 B | 5.3 KB |
./react |
441 KB | 49 KB | 489 KB | 1.4 MB | 180 KB |
./react/beta |
13 KB | 0 B | 13 KB | 25 KB | 13 KB |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
./js |
index.js |
initial | 5.2 KB |
./js |
chunk |
initial | 120 B |
./js |
apache-arrow |
lazy | 49 KB |
./js/beta |
beta.js |
initial | 2.4 KB |
./react |
index.js |
initial | 439 KB |
./react |
tslib |
initial | 2.1 KB |
./react |
apache-arrow |
lazy | 49 KB |
./react/beta |
beta.js |
initial | 13 KB |
ditadi
added a commit
that referenced
this pull request
Oct 30, 2026
The design doc promised behavior the corrected stack does not ship. It now describes what the code does: - The tooling export is @databricks/appkit/beta/database-tooling, beta and internal to the AppKit CLI. - migrate, introspect, clean and init hold config/database/.appkit-db.lock. init holds one lock for its whole run, and init --schema none, seed, verify and clean --delete-branch take none. The doc says how to recover a stale lock file. - init --schema none hands off nothing, and schema public is never handed off. - Values in variable-overrides.json count for the deploy boundary, and an unresolved branch or database reference refuses every write. - Introspect keeps .private() on declared columns, writes new columns private, and refuses a schema.ts that does not load or a foreign key it does not declare. - verify --deployed compares the committed migrations with the source snapshot of the active deployment, and fails when it cannot read it. - Migrations log one line per run. There is no span and no metric. - #675 keeps the plugin and appkit db hidden. A reveal is a later, separate change. The appkit db check section stays as it is until #678 settles. Signed-off-by: ditadi <victordperd@gmail.com>
A fork of the deploy branch carries every row of its source, production data included, and init migrated it as it stood. Without --schema, a branch init forked in this run now gets clean as its start when schema.ts exists, and introspect followed by a rebuild from the baseline it wrote when it does not. A reused branch keeps its data: migrate, or introspect without schema.ts. --schema migrate, or --schema introspect, keeps the copied rows on a new fork. In public, clean removes only your objects, and the report lists what stayed. Before the fork, init writes APPKIT_DB_NEW_BRANCH=<branch> to .env and removes it when the start completes, so a run that stops during or after the fork is finished by its rerun instead of migrating the copied rows into place. A fork refused for permissions or the branch limit removes the marker again. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
For an introspect start, init read the hand-off's schema as the default name even when schema.ts declared another, and let introspect read the default too. Both now use the declared name whenever schema.ts exists; --schema none still reads no schema.ts. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
introspect's refusal for a schema without tables says to pass --schema-name, a flag init does not have. When init relays it, the advice now says to run `appkit db introspect --schema-name <name>`. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…branch The help said a new branch starts with a copy of the default branch's rows. It now says init rebuilds the app schema from the migrations so the branch starts without them, how --schema migrate or introspect keeps them, and that a reused branch is migrated. The report prints why a default run dropped the schema, with the flag that keeps the rows, prints the introspect, drop and migrations of an introspect start with a rebuild, and no longer says a rebuilt branch keeps its approximated objects. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
readDeployTarget reads #666's flattened postgres bindings ({ at, value }), pairing the branch with the database written in the same postgres block. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
env-file kept its own temp-file-and-rename copy; it now uses files.ts with mode 0600, and its symlink refusal builds on the shared check. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
… clean Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…e reader
The fail-closed fix flattened each resource into separate branch and
database values; keep one PostgresBinding per resource (with a whole
marker for a ${…} standing in for the structure), which later readers
that count an app's resources need.
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: ditadi <victordperd@gmail.com>
readDeployTarget reads #666's per-resource postgres bindings again. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…ed migrations Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…se-dev-flow/08-db-check Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…urce name A value with text around projects/<p>/branches/<b>/endpoints/<e> named a branch the refusal of dev and session branches then checked, though the value is not the app's endpoint. Anchor the match so such a value is refused as naming no branch. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
Name the LAKEBASE_ENDPOINT resource name that migrate on start reads the branch from, and that a start without the flag or the app's identity skips the refusal with the migration. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…tack/database-dev-flow/02-default-app-schema Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…ck/database-dev-flow/03-db-migrate Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…signal On SIGINT or SIGTERM the lock was released even when another listener kept the process running, so the command went on writing the history after another command could take the lock. Release and re-raise only when the lock's handler is the one ending the process; otherwise the exit listener releases it. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
A route module that failed to load made migrate fail after it had written the new migration, without saying it kept the file or what the migration warns about. Write database.d.ts and database-operations.d.ts first, so that failure stops migrate before it writes anything; the types still follow schema.ts when applying fails. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
loadDatabaseSchema kept the raw import error as the cause for every caller, including the development start that main keeps to a bounded message. The cause is now attached only when the caller passes showImportError, which only the db CLI does. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
SIGINT and SIGTERM release it only when nothing else handles the signal, and any other way of ending can leave the file for the next command to report. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…ase-dev-flow/04-db-introspect # Conflicts: # packages/appkit/src/database/tooling/migrate.ts Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
loadDatabaseSchema now keeps the import error only for a caller that asks, so introspect asks for it when it loads the schema.ts it replaces and the one it generates. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…tabase-dev-flow/05-db-init # Conflicts: # packages/appkit/src/database/tooling/migrate.ts Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…d seed loadDatabaseSchema now keeps the import error only for a caller that asks, so the commands that read the app schema from schema.ts ask for it. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
The warning about the bound database, the step that points .env at the branch, the hand-off messages and the report the CLI prints carried the Postgres database name raw, so a name with a control character reached the terminal. Pass them through shown(); .env and the connections keep the raw name. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…ed tests Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…-dev-flow/06-db-verify Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
loadDatabaseSchema now keeps the import error only for a caller that asks, so verify asks for it when it reads schema.ts. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
verify escaped the apps API message in its error but kept the raw error as the cause, and the CLI prints the innermost cause as is, so control characters in the API's text reached the terminal. Throw the escaped error alone. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
An included file's source_code_path was joined to the file's folder before its
${var.…} references resolved, so a variable naming an absolute path became
resources/<path>. Keep the path with its file's folder and rebase only a
relative result once it resolves; an absolute one stays as it is and an
unresolved one stays as written.
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: ditadi <victordperd@gmail.com>
…se-dev-flow/07-apps-init Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…se-dev-flow/08-db-check Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
loadDatabaseSchema now keeps the import error only for a caller that asks, so check asks for it when it compares schema.ts with the latest snapshot. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
CI sets CI, so picocolors colors the warning marker and the assertion on "! Could not mark ..." failed there while it passed in a local shell. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…-dev-flow/06-db-verify Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…se-dev-flow/07-apps-init Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
…se-dev-flow/08-db-check Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
ditadi
force-pushed
the
stack/database-dev-flow/07-apps-init
branch
from
November 26, 2026 14:51
7aa8416 to
2032d58
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR (generated by Stack)
Use this link to review incremental changes.
Stacked on #675. The design is #677.
What did you change, and why?
A pull request can break the committed migration history in ways the deployed app finds only on start.
appkit db checkis an offline check of the committed migrations for CI. It reads only the checkout, so it runs without Databricks or Lakebase credentials, and it takes no history lock. It exits 1, with the fix for each finding, when:config/database/schema.tschanged and no committed migration has the changeidxis not its position in the journal, since drizzle-kit names snapshots byidx.sqlor snapshot is not committed, or a.sqlis not in the journalidorprevIdis not a stringThe schema comparison is
hasUnmigratedChangesinmigrations.ts, which sharesdiffSchemawithappkit db migrate. So check fails exactly when migrate would write a migration, and an ambiguous rename counts as a change without a prompt. The comparison runs only when the latest snapshot is a valid drizzle-kit snapshot. Before this revision, anullor{}snapshot skipped both the chain and the schema diff, so check could pass aschema.tschange without a migration.Two pull requests that both add
0001_migrationconflict in git first, and check catches a resolution that keeps both. The fix it names merges the base branch, resetsconfig/database/migrationsto the base branch's, then runsappkit db cleanandappkit db migrate. The clean is there because the developer's branch already ran the old migration.database.mdlistsdb checkamong the commands and among those that take no history lock. Its CI section runs the check on every pull request and explains the conflict. The template README names it.Review round, 2026-11-09:
appkit db checkfails on a journal entry whosewhenis not an integer, a first snapshot not generated from drizzle-kit's empty snapshot, and any snapshot without the v7 PostgreSQL shape.--helpand the template README say check importsschema.ts(run it in CI without secrets) and does not read the.sqlfiles.Fix round for fjakobs's review of #677, 2026-11-15:
How do you know it works?
check.test.tsgenerates real migration history with drizzle-kit and a realschema.ts, with every Databricks and Lakebase call throwing. It covers a sound history, aschema.tschange without its migration, an ambiguous column rename, a merge that keeps two migrations from one snapshot, awhenout of order, anidxthat is not its position, uncommitted and unlisted files, and anulland a{}snapshot. The CLI'scheck.test.tscovers the output and the exit code../betanames as main, and./beta/database-toolingadds onlyrunCheck.appkit db checkmakes no Databricks or Lakebase call.Review round, 2026-11-09: each fix has a failing-then-passing test in its PR, and every layer's appkit and shared tests ran against Postgres 14 after the sync. At the top of the stack,
pnpm build,pnpm test(6502 passed, 1 skipped),pnpm -r typecheck,pnpm check,pnpm knipandpnpm docs:buildpass.Fix round for fjakobs's review, 2026-11-15: each fix has a failing-then-passing test in its PR, and every layer's database, plugin and CLI tests ran against Postgres 17 after the sync. A throwaway Lakebase fork confirmed that the developer role can write the service principal's rows but cannot alter its tables. At the top of the stack,
pnpm test(6602 passed, 1 skipped),pnpm -r typecheck,pnpm buildandpnpm docs:buildpass, and oxlint and oxfmt are clean on every changed file.